package cn.edu.scau.cmi.wujiacheng.mybatis.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.test.context.ContextConfiguration;

import cn.edu.scau.cmi.wujiacheng.mybatis.mapper.StudentMapper;
import cn.edu.scau.cmi.wujiacheng.mybatis.pojo.Student;
import cn.edu.scau.cmi.wujiacheng.mybatis.pojo.Teacher;
import cn.edu.scau.cmi.wujiacheng.mybatis.service.StudentService;

@Service
public class StudentServiceImpl implements StudentService{
	@Autowired
	StudentMapper studentMapper;
	
	public boolean inserStudent(Student student)
	{
		if(studentMapper==null) {
			System.out.print("fuck\n");
		}
		System.out.print(studentMapper);
		return studentMapper.insertStudent(student);
	}
	
	public boolean deleteStudentByID(String stuID)
	{
		return studentMapper.deleteStudentByID(stuID);
	}
	
	public boolean updateStudentName(Student student)
	{
		return studentMapper.updateStudentName(student);
	}
	
	public boolean updateStudentTutorByID(String stuID, String tutorID)
	{
		return studentMapper.updateStudentTutorByID(stuID, tutorID);
	}
	
	public Teacher selectStudentTutor(String stuID)
	{
		return studentMapper.selectStudentTutor(stuID);
	}
}
